#include("common.html")
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>澳邮国际商城</title>
    <meta name="description" content="澳邮国际商城">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="#(tpath)/static/css/element.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/basic.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/filter.css">
    <script src="#(tpath)/static/js/jquery.js"></script>
    <script src="#(tpath)/static/js/common.js"></script>
  </head>
  
  <body class="">
	#include("header.html")
    <style type="text/css">.main_con{ background: #fff; padding: 30px 0 50px; } .stephead { width: 100%; height: 43px; position: relative; border-bottom: 1px solid #dfdfdf; margin: 30px 0 20px ; } .stephead h1 { font: 18px/36px "Microsoft Yahei"; color: #333; } .pay_code .el-dialog--center .el-dialog__body{ text-align: center; padding: 0px 15px 20px; } .el-dialog__body{ padding: 20px; font-size: 16px; } .margin_top{ margin-top: 10px; }</style>
    <div id="balance">
      <div class="main_con">
        <div class="allwarp">
        	<input type="hidden" id="paymentType" value="#(paymentType)">
          <!-- <div role="alert" class="el-alert el-alert--error is-light">
           
            <div class="el-alert__content">
              <span class="el-alert__title">点击充值弹出二维码后，请勿刷新页面，使用手机扫码进行操作后本页面会自动刷新充值结果，如果页面没有返回结果，请到会员中心查看。</span>
             
             
              <i class="el-alert__closebtn el-icon-close"></i>
            </div>
          </div> -->
          <div class="stephead">
            <h1>请选择对应的支付方式</h1></div>
          <div class="margin_top" id="payCheck">
            <label role="radio" aria-checked="true" tabindex="0" class="el-radio is-bordered is-checked" id="wechatCheck"  val="WEIXINPAY_NATIVE">
              <span class="el-radio__input is-checked">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="0"></span>
              <span class="el-radio__label">微信支付
                <!----></span></label>
            <label role="radio" tabindex="0" class="el-radio is-bordered" id="alipayCheck"  val="ALIPAY_WEB">
              <span class="el-radio__input">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="1"></span>
              <span class="el-radio__label">支付宝支付
                <!----></span></label>
          </div>
          <div class="stephead">
            <h1>请选择充值金额 或 自定义充值金额</h1></div>
          <div class="margin_top" id="moneyCheck">
            <label role="radio" aria-checked="true" tabindex="0" class="el-radio is-bordered is-checked" val="100">
              <span class="el-radio__input is-checked">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="100"></span>
              <span class="el-radio__label">￥ 100
                <!----></span></label>
            <label role="radio" tabindex="0" class="el-radio is-bordered"  val="200">
              <span class="el-radio__input">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="200"></span>
              <span class="el-radio__label">￥ 200
                <!----></span></label>
            <label role="radio" tabindex="0" class="el-radio is-bordered"  val="500">
              <span class="el-radio__input">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="500"></span>
              <span class="el-radio__label">￥ 500
                <!----></span></label>
            <label role="radio" tabindex="0" class="el-radio is-bordered"  val="1000">
              <span class="el-radio__input">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="1000"></span>
              <span class="el-radio__label">￥ 1000
                <!----></span></label>
            <label role="radio" tabindex="0" class="el-radio is-bordered" val="0"  id="zidingyiBtn">
              <span class="el-radio__input">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="自定义"></span>
              <span class="el-radio__label">自定义
                <!----></span></label>
          </div>
          
          <div class="margin_top">
		  <div class="el-input el-input-group el-input-group--prepend" id="zidingyiDiv" style="display: none;">
		    <div class="el-input-group__prepend">金额</div>
		    <input type="text" autocomplete="off" placeholder="请输入自定义充值金额" class="el-input__inner" id="money">
		    <!---->
		    <!---->
		    <!---->
		    <!----></div>
		</div>
		
          <!---->
          <div style="margin: 30px 0px;">
            <button type="button" class="el-button el-button--danger" id="payBtn">
              <!---->
              <!---->
              <span>确认并提交充值</span></button>
          </div>
        </div>
      </div>
    </div>
    #include("footer.html")
  </body>

</html>
<script type="text/javascript">
	
	$("#moneyCheck").on("click","label",function(){
		$.each($("#moneyCheck label"),function(index,item){
			$(item).removeClass("is-checked");
			$(item).find(".el-radio__input").removeClass("is-checked");
		});
		$(this).addClass("is-checked");
		$(this).find(".el-radio__input").addClass("is-checked");
		var money = $(this).attr("val");
		if(money=="0"){
			$("#zidingyiDiv").show();
		}else{
			$("#zidingyiDiv").hide();
		}
	});
	
	$("#payCheck").on("click","label",function(){
		$.each($("#payCheck label"),function(index,item){
			$(item).removeClass("is-checked");
			$(item).find(".el-radio__input").removeClass("is-checked");
		});
		$(this).addClass("is-checked");
		$(this).find(".el-radio__input").addClass("is-checked");
	});
	
	$("#payBtn").on("click",function(){
		var money = $("#moneyCheck label.is-checked").attr("val");
		if(money=="0"){
			money = $("#money").val();
			var priceReg = /^[1-9]\d*$/;
			if (!priceReg.test(money)){
			   alert("请输入正确的金额");
			  return false;
			}
		}
		$("#rechargeAmount").html(money);
		var paymentMethod = $("#payCheck label.is-checked").attr("val");
		var paymentType = "RECHARGE";
		location.href="#(base)/payment/pay?paymentMethod="+paymentMethod+"&amount="+money+"&paymentType="+paymentType;
	});
	
</script>